package com.lihao.sam.controller;

import com.lihao.sam.entity.MaintenanceStatistical;
import com.lihao.sam.service.intf.MaintenanceStatisticalService;
import com.lihao.sam.vo.PageVo;
import com.lihao.sam.vo.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author Qinheyun
 * @Description:TODO
 */
@RestController
@RequestMapping("/api/msc/")
public class MaintenanceStatisticalController {
    @Resource
    private MaintenanceStatisticalService service;

//    @PostMapping("add.do")
    @PostMapping("add.do")
    public R add(MaintenanceStatistical maintenanceStatistical){
        System.out.println(maintenanceStatistical);
        return service.add(maintenanceStatistical);
    }

    @PostMapping("update.do")
    public R update(MaintenanceStatistical maintenanceStatistical){
        return service.update(maintenanceStatistical);
    }

    @PostMapping("del.do")
    public R del(int id){
        return service.del(id);
    }

    @GetMapping("page.do")
    public PageVo all(String maintenanceUnits, String maintenanceName, int page, int limit){
        return service.all(maintenanceUnits,maintenanceName,page,limit);
    }

    @GetMapping("num.do")
    public R querNum(){
        return service.querNum();
    }
}
